<template>
    <!--我的提货单详情-->
    <div class="bill_info">
      <div class="infos">
        <div class="title flex p_r20 p_l20 bg_colorfa font_size28">
          <div class="flex-1 color_66 ">未提货</div>
          <div class="flex-1 color_fc t_right">{{orderinfo.type==1?'快递':'自提'}}</div>
        </div>
        <div class="bg_colorff p_r20 p_l20">
          <div class="border_b goodsinfo" v-for="(goodsinfo,index) in  orderinfo.goods_info" :key="index">
            <div class="line50 font_size28">商品名称：{{goodsinfo.goods_name}}</div>
            <div class="line50 font_size24">提货数量：{{goodsinfo.goods_number}}</div>
          </div>
          <div class="m_t40 font_size24 color_66">
            <div class="line50"><span class="spaninfo">提货数量</span><span></span></div>
            <div class="line50"><span class="spaninfo">提货方式</span><span>{{orderinfo.type==1?'快递': '自提'}}</span></div>
            <div class="line50"><span class="spaninfo">提货状态</span>
              <span v-if="orderinfo.type == 1 && orderinfo.status == 0">未发货</span>
              <span v-if="orderinfo.type == 1 && orderinfo.status == 1">已发货</span>
              <span v-if="orderinfo.type == 1 && orderinfo.status == 0">未收货</span>
              <span v-if="orderinfo.type == 2 && orderinfo.status == 0">未提货</span>
              <span v-if="orderinfo.type == 2 && orderinfo.status == 1">已提货</span>
            </div>
            <div class="line50"><span class="spaninfo">提货单号</span><span>{{orderinfo.pick_sn}}</span></div>
            <div class="line50"><span class="spaninfo">提货时间</span><span>{{orderinfo.create_time}}</span></div>
            <div class="line50"><span class="spaninfo" v-if="orderinfo.type==2">提货地点</span><span>{{orderinfo.store_address}}</span></div>
            <div class="line50"><span class="spaninfo" v-if="orderinfo.type==1">收货地址</span><span>{{orderinfo.logistics_address}}</span></div>
            <div class="line50"><span class="spaninfo " v-if="orderinfo.type==1">收货人信息</span><span>{{orderinfo.logistics_name}}{{(orderinfo.logistics_tel)}}</span></div>
            <div class="line50 flex" v-if="orderinfo.type==1">
              <div><span class="spaninfo">快递单号</span><span>25632456423</span></div>
              <div class="flex-1 color_0d t_right">复制单号</div>
            </div>
            <div class="line50"></div>

          </div>

        </div>
      </div>

      <div v-if='orderinfo.st' class="querbtn" @click="cellectgoodsFn">确认收货</div>

      <div class="layer" v-if="iscollect">
        <div class="layer_box t_center">
          <div class="tip_info border_b ">
            <img class="shouhuo_icon" src="../../assets/img/shouhuo.png" />
            <div class="font_size32 color_33">请确认商品已经收到</div>
          </div>
          <div class="flex line90 color_33 font_size32 ">
            <div class="flex-1" @click="querbtn(1)">确认</div>
            <div class="flex-1 border_l"  @click="querbtn(2)">取消</div>
          </div>
        </div>
      </div>

    </div>
</template>

<script>
    export default {
      name: "center_billoflading",
      data(){
          return{
            iscollect: false,
            ordersn: '',
            orderinfo: {}
          }
      },
      mounted(){
        this.getinfosFn()
      },
      created(){
        this.ordersn = this.$route.query.id
      },

      methods: {
        getinfosFn(){
          this.$util.post('user/getUserPickDetail', {
            uid: this.$store.state.userinfo.uid,
            pick_sn: this.ordersn
          }).then(data => {
            if(data.status == 1){
              console.log(data.data)
              this.orderinfo = data.data
            }
          })
        },
        cellectgoodsFn(){
          var self = this
          self.iscollect = !self.iscollect
        },
        querbtn(type){
          var self = this
          self.iscollect = !self.iscollect
        }
      }
    }
</script>

<style lang="less" scoped>
  @import "../../assets/css/center/center_billoflading_info";
</style>
